package com.ykzhujiang.lovespirit.analyzer;

import com.ykzhujiang.lovespirit.entity.LThread;
import com.ykzhujiang.lovespirit.entity.Notice;

public class FemaleAnalyzer implements Analyzer {
	public boolean Analyze(LThread t) {
		if (t != null && t.notices.size() != 0) {
			Notice n = (Notice) t.notices.get(0);
			if (n.getTitle().matches(pie_pattern2)
					|| (n.getTitle().matches(pie_pattern) && n.getTitle()
							.matches(female_pattern))
					|| n.getTitle().matches(pie_pattern3)) {
				if (n.getTitle().matches(pie_pattern4))
					return false;
				return true;
			}
		}
		return false;
	}

	private static String female_pattern = ".*?((?<!(((征)|(找)|(寻)|(觅)|(邀)).{0}))(?<!(((征)|(找)|(寻)|(觅)|(邀)).{1}))"
			+ "(?<!(((征)|(找)|(寻)|(觅)|(邀)).{2}))(?<!(((征)|(找)|(寻)|(觅)|(邀)).{3}))"
			+ "(?<!(((征)|(找)|(寻)|(觅)|(邀)).{4}))(([Mm][Mm])|([Jj][Jj])|(姐)|(妹)|(女))).*?";

	private static String pie_pattern = ".*?(?<!([Gg])|([Dd])|(哥)|(兄)|(弟))挂.*?";

	private static String pie_pattern2 = ".*?(((征)|(找)|(寻)|(觅)|(邀))(?=[^\\s\\(（\\p{Punct}，。；]{0,4}?(([Gg][Gg])|([Dd][Dd])|([Bb][Ff])|(男)|(哥)|(兄)|(弟)))).*?";

	private static String pie_pattern3 = "(([Mm][Mm])|([Jj][Jj])|(姐)|(妹)|(女))[^\\s\\(（\\p{Punct}，。；]{0,4}?征[友婚]";

	private static String pie_pattern4 = ".*?撤牌.*?";
}
